package com.ice.work.moment.facade.user.controller.resource;

import com.honeybee.cloud.framework.common.annotation.ApiVersion;
import com.honeybee.cloud.framework.common.page.Page;
import com.honeybee.cloud.framework.common.response.ResponseEntity;
import com.ice.work.moment.facade.user.request.PageResourceRequest;
import com.ice.work.moment.facade.user.vo.ResourceVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Description 资源controller
 * @Author DELL
 * @Create 2019-02-11
 * @Since 1.0.0
 */
@SuppressWarnings("all")
@FeignClient(value = "moment-user", fallbackFactory = ResourceHystrixFallbackFactory.class)
@RequestMapping("{version}")
@ApiVersion
public interface IResourceController {

    /**
     * 查询资源列表
     *
     * @param request
     * @param page
     * @param size
     * @return
     */
    @PostMapping(value = "/resource-page", name = "查询资源列表")
    @PreAuthorize("hasAuthority('RESOURCE-0001')")
    @ApiVersion(2)
    ResponseEntity<Page<ResourceVO>> pageResource(@RequestBody @Validated PageResourceRequest request, @RequestParam("page") Long page, @RequestParam("size") Long size );


}
